﻿namespace Bowlus.Common
{
    using System;
    using System.Diagnostics;

    public class BowlusLogger
    {
        internal class BowlusLogType
        {
            public static readonly string Info = "INFO";
            public static readonly string Error = "ERROR";
        }

        public static void LogInfo(string info)
        {
            Log(info, BowlusLogType.Info, true);
        }

        public static void LogInfoIf(string info, bool condition)
        {
            Log(info, BowlusLogType.Info, condition);
        }

        public static void LogError(string error)
        {
            Log(error, BowlusLogType.Error, true);
        }

        private static void Log(string msg, string type, bool condition)
        {
            if (condition)
            {
                Trace.TraceInformation(string.Format("BOWLUS {0} {1}: {2}", type, DateTime.Now, msg));
            }
        }
    }
}